<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Master_List extends MY_Controller {

  function __construct()
  {
		parent::__construct();
		$this->page_auth->secure_page(array('registrar','evaluation','president','finance','admin','cashier'));
		$this->load->model(array('M_levels', 'M_enrollees', 'M_sections'));
		$this->load->library(array('form_validation'));
		$this->load->helper(array('url','form'));
		$this->current_user = $this->session->userdata('username').' - '.$this->session->userdata('userType');
	}
	
	public function index()
	{
		$this->load->model('M_search','ms');
		$this->view_data['levels'] = $this->M_levels->get_all_levels_for();
		$this->view_data['sml'] = $this->M_sections->get_section_masterlist_complete();
	}
	
	public function summary()
	{
		$this->view_data['section_master_list'] = $this->M_sections->get_section_masterlist();
		$this->view_data['count'] = function($x,$gender){
										$result = $this->M_enrollees->by_section_id_and_gender($x,$gender);
										if($result > 0)
										{
											return $result;
										}else{
											return 0;
										}
									 };
		$this->view_data['summary'] = $this->M_sections->get_section_summary();
		
	}
}
